<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/amazeui.min.css"/>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/hy.admin.css"/>
	</head>
	<body>
		<div class="am-g">
			 {include file='../Common/hy_header.html'}
			 	
      <div class="am-u-md-6 am-cf">
        <div class="am-fl am-cf">
          <div class="am-btn-toolbar am-fl">
            <div class="am-btn-group am-btn-group-xs">
              <button data-word="本地数据库将会被覆盖，你确定继续" data-href="index.php?g=admin&m=wxmenu&a=refresh_menu" data-confirm type="button" class="am-btn am-btn-default hy-js-ajax"><span class="am-icon-plus"></span> 更新本地</button>
              <button data-word="你确定要删除微信服务器上的菜单？" data-href="index.php?g=admin&m=wxmenu&a=del_menu" data-confirm type="button" class="am-btn am-btn-default hy-js-ajax"><span class="am-icon-plus"></span> 删除菜单</button>
              <button data-word="你确定要覆盖微信服务器上的菜单？" data-href="index.php?g=admin&m=wxmenu&a=sumbit_menu" data-confirm type="button" class="am-btn am-btn-default hy-js-ajax"><span class="am-icon-plus"></span> 提交菜单</button>
              <button data-href="index.php?g=admin&m=wxmenu&a=add_menu" data-confirm type="button" class="am-btn am-btn-default hy-js-window"><span class="am-icon-plus"></span> 新建菜单</button>
            </div>

          </div>
        </div>
      </div>
      <div class="am-u-md-3 am-cf">
        <div class="am-fr">
          
        </div>
      </div>
      
      <div class="am-g">
      <div class="am-u-sm-12">
        <div class="am-form">
          <table class="am-table am-table-striped am-table-hover hy-table-main">
            <thead>
              <tr>
                <th class="table-check"><input class="hy-js-selectall" type="checkbox" /></th><th class="table-id">ID</th><th class="table-title">标题</th><th class="table-type">类别</th><th width="80px" class="table-author">排序</th><th class="table-set">操作</th>
              </tr>
          </thead>
          <tbody>
          	{foreach key=key from=$view_menu item=menu}
            <tr>
              <td><input class="hy-js-id" type="checkbox" value="{$menu.id}"/></td>
              <td>{$menu.id}</td>
              <td><a href="#">{$menu.name}</a></td>
              <td>{if $menu.type==1}链接{elseif $menu.type eq 2}事件{/if}</td>
              <td><input class="hy-js-order hy-w-50" data-id="{$menu.id}" data-action="ordering" type="text"  value="{$menu.ordering}" /></td>
              <td>
                <div class="am-btn-toolbar">
                  <div class="am-btn-group am-btn-group-xs">
                    <button data-href="index.php?g=admin&m=wxmenu&a=edit_menu&id={$menu.id}" class="am-btn am-btn-default am-btn-xs am-text-secondary hy-js-window"><span class="am-icon-pencil-square-o"></span> 编辑</button>
                    <button data-param ="{ url:'index.php?g=admin&m=wxmenu&a=del_btn&id={$menu.id}',hide:4}" class="am-btn am-btn-default am-btn-xs am-text-danger hy-js-del"><span class="am-icon-trash-o"></span> 删除</button>
                  </div>
                </div>
              </td>
            </tr>
            	{if $menu.sub_button} 
            	{foreach from=$menu.sub_button key=subkey item=sub}
            	   <tr>
              <td><input class="hy-js-id" type="checkbox" value="{$sub.id}"/></td>
              <td>{$sub.id}</td>
              <td><a href="#">---{$sub.name}</a></td>
              <td>{if $sub.type==1}链接{elseif $sub.type==2}事件{/if}</td>
              <td><input class="hy-js-order hy-w-50" data-id="{$sub.id}" data-action="ordering" type="text"  value="{$sub.ordering}" /></td>
              <td>
                <div class="am-btn-toolbar">
                  <div class="am-btn-group am-btn-group-xs">
                    <button  data-href="index.php?g=admin&m=wxmenu&a=edit_menu&id={$sub.id}"  class="am-btn am-btn-default am-btn-xs am-text-secondary hy-js-window"><span class="am-icon-pencil-square-o"></span> 编辑</button>
                    <button data-param ="{ url:'index.php?g=admin&m=wxmenu&a=del_btn&id={$sub.id}',hide:4}" class="am-btn am-btn-default am-btn-xs am-text-danger hy-js-del"><span class="am-icon-trash-o"></span> 删除</button>
                  </div>
                </div>
              </td>
            </tr>
            	 {/foreach} 
            	 {/if}
             {/foreach} 
          </tbody>
        </table>
          <div class="am-cf">

  <div class="am-fr">
   {$user_list_page}
  </div>
</div>
          <hr />
      
        </div>
      </div>

    </div>
    </div>
   {include file='../Common/hy_footer.html'}
	</body>
</html>
